import request from '@/utils/request'

// 创建上报事件
export function createEventRecord(data) {
  return request({
    url: '/lamp/event-record/create',
    method: 'post',
    data: data
  })
}

// 更新上报事件
export function updateEventRecord(data) {
  return request({
    url: '/lamp/event-record/update',
    method: 'put',
    data: data
  })
}

// 删除上报事件
export function deleteEventRecord(id) {
  return request({
    url: '/lamp/event-record/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除上报事件 */
export function deleteEventRecordList(ids) {
  return request({
    url: `/lamp/event-record/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得上报事件
export function getEventRecord(id) {
  return request({
    url: '/lamp/event-record/get?id=' + id,
    method: 'get'
  })
}

// 获得上报事件分页
export function getEventRecordPage(params) {
  return request({
    url: '/lamp/event-record/page',
    method: 'get',
    params
  })
}
// 导出上报事件 Excel
export function exportEventRecordExcel(params) {
  return request({
    url: '/lamp/event-record/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}